﻿/*
 * Created by SharpDevelop.
 * User: Andrew
 * Date: 21/04/2013
 * Time: 10:07
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;

namespace RRRSRoguelike.Helpers
{
	/// <summary>
	/// Description of DungeonHelper.
	/// </summary>
	public static class DungeonHelper
	{
		
		//belongs in a helper class
		/// <summary>
		/// Adds to point together
		/// </summary>
		/// <param name="A"></param>
		/// <param name="B"></param>
		/// <returns>returns the sum of two points</returns>
		public static Point AddPoints(Point A, Point B)
		{
			return new Point(A.X + B.X, A.Y + B.Y);
		}

		//belongs in a helper class
		/// <summary>
		/// Gets the vector between two points
		/// </summary>
		/// <param name="A"></param>
		/// <param name="B"></param>
		/// <returns></returns>
		public static Point GetDistanceVector(Point A, Point B)
		{
			return new Point(B.X - A.X, B.Y - A.Y);
		}
		
		//belongs in a helper class
		/// <summary>
		/// always returns positive
		/// </summary>
		/// <param name="A"></param>
		/// <param name="B"></param>
		/// <returns></returns>
		public static int GetDistance(Point A, Point B)
		{
			var result = GetDistanceVector(A, B);

			return (Math.Abs(result.X) + Math.Abs(result.Y));
		}
	}
}
